package com.whg.opengl;

import android.content.Context;
import android.opengl.GLSurfaceView;
import android.util.AttributeSet;

/**
 * author : Whg
 * e-mail : guanhuawei@ksjgs.com
 * date   : 2019-10-1109:05
 * desc   :
 * version: 1.0
 * Stay hungry,stay foolish.
 */
public class FGLView extends GLSurfaceView {

    public FGLView(Context context) {
        super(context);
    }

    public FGLView(Context context, AttributeSet attrs) {
        super(context, attrs);
        //设置opengl版本
        setEGLContextClientVersion(2);
        setRenderer(new FGLRender(this));
//        requestRender();
        //设置渲染模式
        //按需渲染，效率高
        setRenderMode(GLSurfaceView.RENDERMODE_WHEN_DIRTY);
    }
}
